@include('header')

<div class="content">
    <div class="container">
        <div class="row">
            <div class="col-md-1 sidebar">

                {{--左侧分类栏目--}}
                @include('categorylist')

            </div>
            <div class="col-md-11">
                <!--Start-->
                @foreach($list as $k=>$v)
                    <div class="part current" id="{{$v['id']}}" data-title="{{$v['name']}}">
                        <h2 class="has_link ">
                            <strong>{{$v['name']}}</strong>
                            @if(count($v['list']) >= 6)
                            <a href="/more/{{$v['id']}}">更多 &gt;</a>
                            @endif
                        </h2>
                        <div class="items ">
                            <div class="row">
                                @foreach($v['list'] as $vv)
                                    <div class="col-xs-6 col-sm-4 col-md-2">
                                        <div class="item">
                                            <a href="javascript:void(0);" onclick ="go_to('{{$vv['url']}}','{{$vv['is_login']}}')" rel="nofollow" target="_blank" title="{{$vv['name']}}">
                                                <img src="{{$vv['image']}}">
                                                <h3 style="margin-top: 0;">
                                                    {{$vv['name']}}
                                                </h3>
                                                <p>{{$vv['description']}}</p>
                                            </a>
                                        </div>
                                    </div>
                                @endforeach
                            </div>
                        </div>
                    </div>

                @endforeach
                <!--end-->
                <div class="content-words">
                </div>
                <div class="content-linkto "></div>
            </div>
        </div>
    </div>
</div>

<script>

    function go_to(url,is_login) {

        if(is_login == 1){
            var user = JSON.parse(sessionStorage.getItem("users"));
            if(!user){
                window.location.href = '/login';
            }else{
                window.location.href = url + "?username="+user.username+"&type_id=0";
            }

        }else{
            window.location.href = url;
        }

    }


</script>




@include('footer')